Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup ESLint #41

Merged
merged 5 commits into from
Feb 28, 2024
Merged

Setup ESLint #41

merged 5 commits into from
Feb 28, 2024

Conversation

alexbainter
Copy link
Collaborator

Closes #31.
Relates to #23. ESLint should tell us if we try to use features from ES7+.
Relates to #39.

Changes

  • Adds a package.json file to support npm dependencies
  • Adds ESLint as a dev dependency from npm
  • Adds an ESLint configuration file with just the basic recommended rules for now. It applies to all JavaScript files in static/js except for minified ones like html.min.js.
  • Adds an npm script so we can run the linter with npm run lint
  • Adds a GitHub Action to run ESLint for pull requests to the main branch
  • Adds linting instructions to README.md
  • Fixes a few bad practices ESLint already caught (missing variable declarations)

Notes

For now I'm just informing ESLint about global variables like lucide and queryStructure at the top of the files that use them.

@alexbainter alexbainter requested a review from lisad February 27, 2024 19:50
@alexbainter
Copy link
Collaborator Author

Woo!

image

@alexbainter alexbainter merged commit 1a20e68 into main Feb 28, 2024
2 checks passed
@alexbainter alexbainter deleted the alex-31-js-lint branch February 28, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup JS linting to catch common issues
2 participants